package com.sh.data.engine.application.model.dto.normalization.modeldesign;

import io.swagger.v3.oas.annotations.media.Schema;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.util.List;

/**
 * @author : changkong
 * @date : 2022/1/6
 */
@Data
@Builder
@Schema
@NoArgsConstructor
@AllArgsConstructor
public class ModelResponse {

    @Schema(description = "模型id")
    private Long id;

    @Schema(description = "模型中文名")
    private String cnName;

    @Schema(description = "模型英文名")
    private String enName;

    @Schema(description = "schema")
    private String schema;

    @Schema(description = "主题")
    private Long themeId;

    @Schema(description = "生命周期, 0-永久")
    private int lifeCycle;

    /**
     * 数据密级
     */
    @Schema(description = "数据密级")
    private Long dataSecretId;

    @Schema(description = "是否支持富文本")
    private boolean supportRtf;

    @Schema(description = "字段列表")
    private List<Field> fields;

    @Schema(
        name = "当前表存储类型是否为hive",
        description = "为true时: 富文本单选框和分区列可以勾选, 必填列置灰禁止勾选; false时, 必填列可以勾选, 富文本单选框和分区列禁止勾选")
    private boolean hive;

    @Data
    @NoArgsConstructor
    @AllArgsConstructor
    public static class Field {
        @Schema(description = "字段名")
        private String fieldName;

        @Schema(description = "字段描述")
        private String fieldDesc;

        @Schema(description = "字段类型")
        private String fieldType;

        @Schema(description = "是否必填")
        private Boolean required;

        @Schema(description = "是否分区")
        private Boolean isPartition;
    }
}
